package com.zx.cloud.config;  
  
import java.util.List;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.zx.cloud.common.filter.CurrentUserIdArgumentResolver;
import com.zx.cloud.common.filter.AuthAnnotationInterceptor;
  
@Configuration  
public class WebConfiguration extends WebMvcConfigurerAdapter {  
  
    @Override  
    public void addInterceptors(InterceptorRegistry registry) {  
        registry.addInterceptor(new AuthAnnotationInterceptor()).addPathPatterns("/**").excludePathPatterns("/swagger-resources/**");   
        super.addInterceptors(registry);  
    }  
      
    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
    	argumentResolvers.add(new CurrentUserIdArgumentResolver());   
    	super.addArgumentResolvers(argumentResolvers);
    }
    
}